home *** CD-ROM | disk | FTP | other *** search
/ ftp.anonawest.com / ftp.anonawest.com.tar / ftp.anonawest.com / Memorial Day+TAPS_files / mailcommonlib.js < prev    next >
Text File  |  2013-02-25  |  50KB  |  1,809 lines

  1. function FlashDetector_Detect() {
  2.     var pObj = null;
  3.     var tokens, len, curr_tok;
  4.     var hasVersion = -1;
  5.     if(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'])
  6.     {
  7.         pObj = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
  8.     }
  9.     if(pObj != null)
  10.     {
  11.         tokens = navigator.plugins['Shockwave Flash'].description.split(' ');
  12.         len = tokens.length;
  13.         while(len--)
  14.         {
  15.             curr_tok = tokens[len];
  16.             if(!isNaN(parseInt(curr_tok)))
  17.             {
  18.                 hasVersion = curr_tok;
  19.                 FlashDetector_Version = curr_tok;
  20.                 break;
  21.             }
  22.         }
  23.         if(hasVersion >= FlashDetector_TargetVersion)
  24.         {
  25.             playable = true;
  26.         }
  27.         else
  28.         {
  29.             playable = false;
  30.         }
  31.     }
  32.     return playable;
  33. }
  34.  
  35. <!--
  36.  
  37. function ylib_Browser()
  38. {
  39.     d=document;
  40.     this.agt=navigator.userAgent.toLowerCase();
  41.     this.major = parseInt(navigator.appVersion);
  42.     this.dom=(d.getElementById)?1:0;
  43.     this.ns=(d.layers);
  44.     this.ns4up=(this.ns && this.major >=4);
  45.     this.ns6=(this.dom&&navigator.appName=="Netscape");
  46.     this.op=(window.opera? 1:0);
  47.     this.ie=(d.all);
  48.     this.ie4=(d.all&&!this.dom)?1:0;
  49.     this.ie4up=(this.ie && this.major >= 4);
  50.     this.ie5=(d.all&&this.dom);
  51.     this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
  52.     this.mac=(this.agt.indexOf("mac")!=-1);
  53. };
  54.  
  55. var oBw = new ylib_Browser();
  56.  
  57. function ylib_getObj(id,d)
  58. {
  59.     var i,x;  if(!d) d=document; 
  60.     if(!(x=d[id])&&d.all) x=d.all[id]; 
  61.     for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][id];
  62.     for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=ylib_getObj(id,d.layers[i].document);
  63.     if(!x && document.getElementById) x=document.getElementById(id); 
  64.     return x;
  65. };
  66.  
  67. function ylib_getH(o) { return (oBw.ns)?((o.height)?o.height:o.clip.height):((oBw.op&&typeof o.style.pixelHeight!='undefined')?o.style.pixelHeight:o.offsetHeight); };
  68. function ylib_setH(o,h) { if(o.clip) o.clip.height=h; else if(oBw.op && typeof o.style.pixelHeight != 'undefined') o.style.pixelHeight=h; else o.style.height=h; };
  69. function ylib_getW(o) { return (oBw.ns)?((o.width)?o.width:o.clip.width):((oBw.op&&typeof o.style.pixelWidth!='undefined')?w=o.style.pixelWidth:o.offsetWidth); };
  70. function ylib_setW(o,w) { if(o.clip) o.clip.width=w; else if(oBw.op && typeof o.style.pixelWidth != 'undefined') o.style.pixelWidth=w; else o.style.width=w; };
  71. function ylib_getX(o) { return (oBw.ns)?o.left:((o.style.pixelLeft)?o.style.pixelLeft:o.offsetLeft); };
  72. function ylib_setX(o,x) { if(oBw.ns) o.left=x; else if(typeof o.style.pixelLeft != 'undefined') o.style.pixelLeft=x; else o.style.left=x; };
  73. function ylib_getY(o) { return (oBw.ns)?o.top:((o.style.pixelTop)?o.style.pixelTop:o.offsetTop); };
  74. function ylib_setY(o,y) { if(oBw.ns) o.top=y; else if(typeof o.style.pixelTop != 'undefined') o.style.pixelTop=y; else o.style.top=y; };
  75. function ylib_getPageX(o) { var x=0; if(oBw.ns) x=o.pageX; else { while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } } return x; };
  76. function ylib_getPageY(o) { var y=0; if(oBw.ns) y=o.pageY; else { while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; } } return y; };
  77. function ylib_getZ(o) { return (oBw.ns)?o.zIndex:o.style.zIndex; };
  78. function ylib_moveTo(o,x,y) { ylib_setX(o,x);ylib_setY(o,y); };
  79. function ylib_moveBy(o,x,y) { ylib_setX(o,ylib_getPageX(o)+x);ylib_setY(o,ylib_getPageY(o)+y); };
  80. function ylib_setZ(o,z) { if(oBw.ns)o.zIndex=z;else o.style.zIndex=z; };
  81. function ylib_show(o,disp) { (oBw.ns)? '':(!disp)? o.style.display="inline":o.style.display=disp; (oBw.ns)? o.visibility='show':o.style.visibility='visible'; };
  82. function ylib_hide(o,disp) { (oBw.ns)? '':(arguments.length!=2)? o.style.display="none":o.style.display=disp; (oBw.ns)? o.visibility='hide':o.style.visibility='hidden'; };
  83. function ylib_setStyle(o,s,v) { if(oBw.ie5||oBw.dom) eval("o.style."+s+" = '" + v +"'"); };
  84. function ylib_getStyle(o,s) { if(oBw.ie5||oBw.dom) return eval("o.style."+s); };
  85. function ylib_addEvt(o,e,f,c){ if(o.addEventListener)o.addEventListener(e,f,c);else if(o.attachEvent)o.attachEvent("on"+e,f);else eval("o.on"+e+"="+f) };
  86. function ylib_writeHTML(o,h) { if(oBw.ns){var doc=o.document;doc.write(h);doc.close();return false;} if(o.innerHTML)o.innerHTML=h; };
  87.  
  88. function ylib_insertHTML(o,h,w)
  89. {
  90.     if(oBw.op) return;
  91.     if(o.insertAdjacentHTML)
  92.     { 
  93.         o.insertAdjacentHTML(w,h);
  94.         return;
  95.     }
  96.     if(oBw.ns)
  97.     {
  98.         ylib_writeHTML(o,h);
  99.         return;
  100.     }
  101.     var r = o.ownerDocument.createRange();
  102.     r.setStartBefore(o);
  103.     var frag = r.createContextualFragment(h);
  104.     ylib_insertObj(o,w,frag);
  105. };
  106.  
  107. function ylib_insertObj(o,w,node)
  108. {
  109.     switch(w)
  110.     {
  111.         case 'beforeBegin':
  112.             o.parentNode.insertBefore(node,o);
  113.         break;
  114.  
  115.         case 'afterBegin':
  116.             o.insertBefore(node,o.firstChild);
  117.         break;
  118.  
  119.         case 'beforeEnd':
  120.             o.appendChild(node);
  121.         break;
  122.  
  123.         case 'afterEnd':
  124.             if (o.nextSibling) o.parentNode.insertBefore(node,o.nextSibling);
  125.             else o.parentNode.appendChild(node);
  126.         break;
  127.     }
  128. };
  129.  
  130. function addEvent( obj, evType, fn, useCapture )
  131. {
  132.     if ( obj.addEventListener ) {
  133.         obj.addEventListener( evType, fn, useCapture );
  134.         return true;
  135.     }
  136.     
  137.     if ( obj.attachEvent ) {
  138.         return obj.attachEvent( "on" + evType, fn );
  139.     }
  140.     
  141.     alert( "Unable to add event listener for " + evType + " to " + obj.tagName );
  142. }
  143.  
  144. function removeEvent( obj, evType, fn, useCapture )
  145. {
  146.     if ( obj.removeEventListener ) {
  147.         obj.removeEventListener( evType, fn, useCapture );
  148.         return true;
  149.     }
  150.     if ( obj.detachEvent ) {
  151.         return obj.detachEvent( "on" + evType, fn );
  152.     }
  153.     
  154.     alert( "Unable to remove event listener for " + evType + " from " + obj.tagName );
  155. }
  156. // ---------- Style sheet utilities
  157.  
  158.  
  159. // add a new stylesheet to the document
  160. function addStyleSheet ( doc, id )
  161. {
  162.     if ( doc == null ) {
  163.         return;
  164.     }
  165.     
  166.     if ( id != null ) {
  167.         removeStyleSheet ( doc, id );
  168.     }
  169.     
  170.     var styleElt = doc.createElement( "STYLE" );
  171.     if ( id != null ) {
  172.         styleElt.id = id;
  173.     }
  174.     doc.getElementsByTagName( "HEAD" ).item( 0 ).appendChild( styleElt );
  175.     return doc.styleSheets[ doc.styleSheets.length-1 ];
  176. }
  177.  
  178. // add a new stylesheet to the document
  179. function removeStyleSheet ( doc, id ) {
  180.     var sheets = doc.getElementsByTagName( "STYLE" );
  181.     var n;  // for munger;
  182.     for ( var i=0, n=sheets.length; i<n; ++i ) {
  183.         if ( sheets[i].id == id ) {
  184.             sheets[i].parentNode.removeChild ( sheets[i] );
  185.             return sheets[i];
  186.         }
  187.     }
  188.     return null;
  189. }
  190.  
  191. // add a new rule to a stylesheet; this API is very
  192. // different between IE and Mozilla
  193. function addStylesheetRule ( styleSheet, name, styles )
  194. {
  195.     if ( styleSheet == null ) {
  196.         return;
  197.     }
  198.     // generally we prefer "can we do X?" tests,
  199.     // versus "what browser are we running?" tests 
  200.     if ( typeof styleSheet.addRule != "undefined" )
  201.         styleSheet.addRule( name, styles );
  202.     else if ( typeof styleSheet.insertRule != "undefined" )
  203.         styleSheet.insertRule( name + " { " + styles + " }", styleSheet.cssRules.length );
  204. }
  205.  
  206. var YLIB_SHIFT_KEYCODE = 16;
  207. var YLIB_CTRL_KEYCODE = 17;
  208. var YLIB_ALT_KEYCODE = 18;
  209. var YLIB_SHIFT = "shift";
  210. var YLIB_CTRL = "ctrl";
  211. var YLIB_ALT = "alt";
  212.  
  213. ylib_keyevt.count=0;
  214.  
  215. function ylib_keyevt(elm)
  216. {
  217.     this.id = "keyevt"+ylib_keyevt.count++;
  218.     eval(this.id + "=this");
  219.     this.keys = new Array();
  220.     this.shift=0;
  221.     this.ctrl=0;
  222.     this.alt=0;
  223.     this.addKey = ylib_addKey;
  224.     this.keyevent = ylib_keyevent;
  225.     this.checkModKeys = ylib_checkModKeys;
  226. };
  227.  
  228. function ylib_addKey(cdom,cns4,a,m)
  229. {
  230.     if(oBw.ie||oBw.dom) this.keys[cdom] = [a,m];
  231.     else this.keys[cns4] = [a,m];
  232. };
  233.  
  234. var YLIB_COUNT=0;
  235.  
  236. function ylib_keyevent(evt)
  237. {
  238.     if(oBw.ie||oBw.op) evt=event;
  239.     var k = (oBw.ie||oBw.op||oBw.ns6)? evt.keyCode:evt.which;
  240.     this.checkModKeys(evt,k);
  241.     if(this.keys[k]==null) return false;
  242.     var m = this.keys[k][1];
  243.     if((this.shift && (m.indexOf(YLIB_SHIFT) != -1) || !this.shift && (m.indexOf(YLIB_SHIFT) == -1)) && (this.ctrl && (m.indexOf(YLIB_CTRL) != -1) || !this.ctrl && (m.indexOf(YLIB_CTRL) == -1)) && (this.alt && (m.indexOf("alt") != -1) || !this.alt && (m.indexOf("alt") == -1)))
  244.     {
  245.         var a = this.keys[k][0];
  246.         a = eval(a); 
  247.         if(typeof a == "function") a();
  248.     }
  249. };
  250.  
  251. function ylib_checkModKeys(e,k)
  252. {
  253.     if(oBw.dom)
  254.     { 
  255.         this.shift = e.shiftKey;
  256.         this.ctrl = e.ctrlKey;
  257.         this.alt = e.altKey;
  258.     }
  259.     else
  260.     {
  261.         // for opera
  262.         this.shift = (k==YLIB_SHIFT_KEYCODE) ? 1:0;
  263.         this.ctrl = (k==YLIB_CTRL_KEYCODE) ? 1:0;
  264.         this.alt = (k==YLIB_ALT_KEYCODE) ? 1:0;
  265.     }
  266. };
  267.  
  268. var oKey = new ylib_keyevt();
  269.  
  270. /* Buttons */
  271.  
  272. function ClickButton(p_sButtonId, p_sHiddenFieldId, p_oClickHandler)
  273. {
  274.     var oButton = document.getElementById(p_sButtonId);
  275.  
  276.     if(oButton && oButton.form)
  277.     {
  278.         var oHiddenField = document.getElementById(p_sHiddenFieldId);
  279.  
  280.         if(oHiddenField)
  281.         {
  282.             oButton.HiddenField = oHiddenField;
  283.             oButton.HiddenField.value = "";
  284.             oButton.onclick = function () {
  285.                 if(typeof p_oClickHandler != 'undefined' && p_oClickHandler) p_oClickHandler();
  286.                 this.HiddenField.value = this.value;
  287.                 this.form.submit();
  288.             };
  289.             
  290.             return oButton;
  291.         }
  292.         else return false;
  293.     }
  294.     else return false;
  295. };
  296.  
  297. function Menu_Click(p_oEvent)
  298. {
  299.     var oEvent = p_oEvent ? p_oEvent : window.event;
  300.     var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;
  301.  
  302.     if(p_oEvent) oEvent.stopPropagation();
  303.     else oEvent.cancelBubble = true;
  304.     
  305.     this.Sender = oSender;
  306.     this.Event = oEvent;
  307.     
  308.     if(typeof this.ClickHandler != 'undefined') this.ClickHandler();
  309. };
  310.  
  311. function Menu_MouseOver(p_oEvent)
  312. {
  313.     var oEvent = p_oEvent ? p_oEvent : window.event;
  314.     var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;
  315.     
  316.     if(oSender.tagName == 'LI') oSender.className = 'hover';
  317.     else if(oSender.tagName == 'A') oSender.parentNode.className = 'hover';
  318.     else return false;
  319. };
  320.  
  321. function Menu_MouseOut(p_oEvent)
  322. {
  323.     var oEvent = p_oEvent ? p_oEvent : window.event;
  324.     var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;
  325.     
  326.     if(oSender.tagName == 'LI') oSender.className = '';
  327.     else if(oSender.tagName == 'A') oSender.parentNode.className = '';
  328.     else return false;    
  329. };
  330.  
  331. function Button_Click(p_oEvent)
  332. {
  333.     var oEvent = p_oEvent ? p_oEvent : window.event;
  334.     var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;
  335.  
  336.     if(p_oEvent) oEvent.stopPropagation();
  337.     else oEvent.cancelBubble = true;
  338.  
  339.     this.Event = oEvent;
  340.     this.Sender = oSender;
  341.  
  342.     HideMenu();
  343.     this.Menu.Button = this;
  344.     g_oMenu = this.Menu;
  345.  
  346.     if(typeof this.ClickHandler != 'undefined') this.ClickHandler();
  347.     else g_oMenu.Show();
  348.     
  349.     document.onclick = Document_Click;
  350. };
  351.  
  352. function showIFrameShim( theDiv )
  353. {
  354.     var theShim = document.getElementById( "DivShim" );
  355.     if ( theShim != null ) {
  356.         theShim.style.width = theDiv.offsetWidth;
  357.         theShim.style.height = theDiv.offsetHeight;
  358.         theShim.style.top = theDiv.style.top;
  359.         theShim.style.left = theDiv.style.left;
  360.  
  361.         theShim.style.display = "block";
  362.     }
  363. }
  364.  
  365. function hideIFrameShim()
  366. {
  367.     var theShim = document.getElementById( "DivShim" );
  368.     if ( theShim != null ) {
  369.         theShim.style.display = "none";
  370.     }
  371. }
  372.  
  373. function ButtonMenu(p_sMenuId, p_oClickHandler)
  374. {
  375.     var oMenu = document.getElementById(p_sMenuId);
  376.  
  377.     if ( oMenu ) {
  378.         if ( typeof p_oClickHandler != 'undefined' ) oMenu.ClickHandler = p_oClickHandler;
  379.             
  380.         oMenu.Show = function () {
  381.             if(document.all) this.style.width = this.offsetWidth+'px';
  382.  
  383.             var nTop = ylib_getPageY( this.Button );
  384.             var nLeft = ylib_getPageX( this.Button );
  385.             
  386.             var containerID = this.getAttribute( "container" );
  387.             if ( containerID != null ) {
  388.                 var container = document.getElementById( containerID );
  389. var altContainer = document.getElementById( "bufu" );
  390. if ( altContainer != null ) { container = altContainer; }
  391.                 nTop =  ygPos.getY( this.Button ) - ygPos.getY( container );
  392.                 nLeft = ygPos.getX( this.Button ) - ygPos.getX( container );
  393.             }
  394.             nTop += this.Button.offsetHeight;
  395.             
  396.             if ( oBw.ie && oBw.mac ) {
  397.                 nTop -= 4;
  398.                 nLeft -= 6;    
  399.             }
  400.  
  401.             this.style.top = nTop+'px';
  402.             this.style.left = nLeft+'px';
  403.             this.style.visibility = 'visible'; 
  404.         };
  405.             
  406.         oMenu.onclick = Menu_Click;
  407.         
  408.         if( document.all ) {
  409.             oMenu.onmouseover = Menu_MouseOver;
  410.             oMenu.onmouseout = Menu_MouseOut;
  411.         }
  412.  
  413.         return oMenu;
  414.     }
  415.     return false;
  416. };
  417.  
  418. function Button(p_sButtonId)
  419. {
  420.     var oButton = document.getElementById(p_sButtonId);
  421.     
  422.     if(oButton)
  423.     {
  424.         oButton.onclick = Button_Click;
  425.         return oButton;
  426.     }
  427.     else return false;
  428. };
  429.  
  430. function MenuButton()
  431. {
  432.     var nArguments = arguments.length;
  433.     
  434.     function __MenuButton_TwoArguments(p_sButtonId, p_sMenuId)
  435.     {
  436.         var oButton = Button(p_sButtonId);
  437.     
  438.         if(oButton) {
  439.             oButton.Menu = new ButtonMenu(p_sMenuId);
  440.             return oButton;
  441.         }
  442.         return false;    
  443.     };
  444.     
  445.     function __MenuButton_ThreeArguments(p_sButtonId, p_sMenuId, p_oMenuClickHandler)
  446.     {
  447.         var oButton = Button(p_sButtonId);
  448.             
  449.         if(oButton) {
  450.             oButton.Menu = new ButtonMenu(p_sMenuId, p_oMenuClickHandler);
  451.             return oButton;
  452.         }
  453.         return false;
  454.     };
  455.     
  456.     function __MenuButton_FourArguments(p_sButtonId, p_oButtonClickHandler, p_sMenuId, p_oMenuClickHandler)
  457.     {
  458.         var oButton = Button(p_sButtonId);
  459.             
  460.         if(oButton && typeof p_oButtonClickHandler != 'undefined') {
  461.             oButton.ClickHandler = p_oButtonClickHandler;
  462.             oButton.Menu = new ButtonMenu(p_sMenuId, p_oMenuClickHandler);
  463.             return oButton;
  464.         }
  465.         return false;
  466.     };
  467.  
  468.     if(nArguments == 2) return __MenuButton_TwoArguments(arguments[0],arguments[1]);
  469.     if(nArguments == 3) return __MenuButton_ThreeArguments(arguments[0],arguments[1],arguments[2]);
  470.     if(nArguments == 4) return __MenuButton_FourArguments(arguments[0],arguments[1],arguments[2],arguments[3]);
  471.     return false;
  472. };
  473.  
  474. /* Mail + PIM Tabs */
  475.  
  476. function Tab_MouseOver()
  477. {
  478.     if(!this.Selected) this.className = "hover";
  479.     return false;
  480. };
  481.  
  482. function Tab_MouseOut()
  483. {
  484.     if(!this.Selected) this.className = "";
  485.     return false;    
  486. };
  487.  
  488. function PIMMenu_Click(p_oEvent)
  489. {
  490.     var oEvent = p_oEvent ? p_oEvent : window.event;
  491.     if(p_oEvent) oEvent.stopPropagation();
  492.     else oEvent.cancelBubble = true;
  493.     if(oEvent && oEvent.target && oEvent.target.parentNode && oEvent.target.parentNode.tagName == "A") window.location = oEvent.target.parentNode.href;
  494. };
  495.  
  496. function Arrow_Click(p_oEvent)
  497. {
  498.     document.Selects = document.getElementsByTagName('select');
  499.  
  500.     if(document.Selects[0])
  501.     {
  502.         var nSelects = document.Selects.length-1;
  503.         for(var i=nSelects;i>=0;i--) document.Selects[i].style.visibility = 'hidden';
  504.     }
  505.     
  506.     var oAvatar = document.getElementById("swfcontainer");
  507.     
  508.     if(oAvatar) {
  509.         oAvatar.style.visibility = "hidden";
  510.     }
  511.  
  512.     var oEvent = p_oEvent || window.event;
  513.     
  514.     if(p_oEvent) oEvent.stopPropagation();
  515.     else oEvent.cancelBubble = true;
  516.     
  517.     HideMenu();
  518.     
  519.     var oTab = this.parentNode.parentNode;
  520.     var nTop = (oTab.offsetTop+oTab.parentNode.offsetHeight);
  521.     var sTop = ((oTab.Selected) ? (nTop+2) : (nTop-1)) + "px";
  522.     
  523.     g_oMenu = document.getElementById(this.href.split('#')[1]);
  524.     g_oMenu.style.top = sTop;
  525.     g_oMenu.style.left = oTab.offsetLeft+"px";
  526.  
  527.     g_oMenu.onclick = PIMMenu_Click;
  528.     g_oMenu.style.visibility = "visible";
  529.  
  530.     document.onclick = Document_Click;    
  531.  
  532.     return false;
  533. };
  534.  
  535. function Tabs_Init()
  536. {
  537.     var oMailTab = document.getElementById('mailtab');
  538.     var oMobileTab = document.getElementById('mobiletab');
  539.     var oAddressBookTab = document.getElementById('addressbooktab');
  540.     var oCalendarTab = document.getElementById('calendartab');
  541.     var oNotepadTab = document.getElementById('notepadtab');        
  542.     
  543.     if(oMailTab)
  544.     {
  545.         oMailTab.getElementsByTagName("a")[1].onclick = Arrow_Click;
  546.         oMailTab.onmouseover = Tab_MouseOver;
  547.         oMailTab.onmouseout = Tab_MouseOut;
  548.         oMailTab.Selected = (oMailTab.className == 'selected' || oMailTab.className == 'first selected') ? true : false;
  549.     }
  550.  
  551.     if(oMobileTab)
  552.     {
  553.         oMobileTab.getElementsByTagName("a")[1].onclick = Arrow_Click;
  554.         oMobileTab.onmouseover = Tab_MouseOver;
  555.         oMobileTab.onmouseout = Tab_MouseOut;
  556.         oMobileTab.Selected = (oMobileTab.className == 'selected' || oMobileTab.className == 'first selected') ? true : false;
  557.     }
  558.  
  559.     if(oAddressBookTab)
  560.     {
  561.         oAddressBookTab.getElementsByTagName("a")[1].onclick = Arrow_Click;
  562.         oAddressBookTab.onmouseover = Tab_MouseOver;
  563.         oAddressBookTab.onmouseout = Tab_MouseOut;
  564.         oAddressBookTab.Selected = (oAddressBookTab.className == 'selected' || oAddressBookTab.className == 'first selected') ? true : false;
  565.     }
  566.  
  567.     if(oCalendarTab)
  568.     {
  569.         oCalendarTab.getElementsByTagName("a")[1].onclick = Arrow_Click;
  570.         oCalendarTab.onmouseover = Tab_MouseOver;
  571.         oCalendarTab.onmouseout = Tab_MouseOut;
  572.         oCalendarTab.Selected = (oCalendarTab.className == 'selected' || oCalendarTab.className == 'first selected') ? true : false;
  573.     }
  574.  
  575.     if(oNotepadTab)
  576.     {
  577.         oNotepadTab.getElementsByTagName("a")[1].onclick = Arrow_Click;
  578.         oNotepadTab.onmouseover = Tab_MouseOver;
  579.         oNotepadTab.onmouseout = Tab_MouseOut;
  580.         oNotepadTab.Selected = (oNotepadTab.className == 'selected' || oNotepadTab.className == 'first selected') ? true : false;
  581.     }
  582.  
  583.     return false;
  584. };
  585.  
  586. function HideMenu()
  587. {
  588.     if(typeof g_oMenu != 'undefined' && g_oMenu)
  589.     {
  590.         if(g_oMenu.Hide) g_oMenu.Hide();
  591.         else g_oMenu.style.visibility = 'hidden';
  592.         
  593.         var hideCB = g_oMenu.hideCB;
  594.         if ( typeof hideCB == "function" ) {
  595.             hideCB.call( g_oMenu );
  596.         }
  597.         
  598.         g_oMenu = null;
  599.         document.onclick = null;
  600.         window.onresize = null;
  601.     }
  602.     else return;
  603. };
  604.  
  605. function Document_Click()
  606. {
  607.     if(document.Selects)
  608.     {
  609.         var nSelects = document.Selects.length-1;
  610.         for(var i=nSelects;i>=0;i--) document.Selects[i].style.visibility = 'visible';
  611.     }
  612.  
  613.     var oAvatar = document.getElementById("swfcontainer");
  614.     
  615.     if(oAvatar) {
  616.         oAvatar.style.visibility = "visible";
  617.     }
  618.     
  619.     HideMenu();
  620. };
  621.  
  622. /* Left navigation */
  623.  
  624. function LeftNav_Click(p_oEvent)
  625. {
  626.     var oEvent = p_oEvent ? p_oEvent : window.event;
  627.     var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;
  628.     var oAnchor = oSender.getElementsByTagName('a')[0];
  629.  
  630.     if(oSender.tagName == 'LI' && oAnchor)
  631.     {
  632.         var oWindow = (oAnchor.target == "_top") ? window.parent : window;
  633.         oWindow.document.location = oAnchor.href;
  634.     }
  635. };
  636.  
  637. function LeftNav_MouseOver(p_oEvent)
  638. {
  639.     var oEvent = p_oEvent ? p_oEvent : window.event;
  640.     var oTarget = oEvent.target ? oEvent.target : oEvent.srcElement;
  641.     oTarget = oTarget.nodeType != 1 ? oTarget.parentNode : oTarget;
  642.  
  643.     var oLI;
  644.     
  645.     if(oTarget.tagName == "LI") oLI = oTarget;
  646.     else if(oTarget.parentNode.tagName == "LI") oLI = oTarget.parentNode;
  647.     else if(oTarget.parentNode.parentNode.tagName == "LI") oLI = oTarget.parentNode.parentNode;
  648.  
  649.     if(oLI) {
  650.  
  651.         var bEmptyLink = false;
  652.     
  653.         if(oTarget.tagName == "A")
  654.         {
  655.             if(oTarget.parentNode.tagName == "SPAN")
  656.             {
  657.                 oTarget.style.textDecoration = 'underline';
  658.                 bEmptyLink = true;
  659.             }
  660.         }
  661.     
  662.         if(oLI.className != 'selected')
  663.         {
  664.             oLI.previousClassName = oLI.className;
  665.             oLI.className = (oLI.previousClassName.length > 0) ? oLI.previousClassName+' hover' : 'hover';
  666.             if ( typeof oLI.firstChild != "undefined" && typeof oLI.firstChild.style != "undefined" ) {
  667.                 oLI.firstChild.style.textDecoration = bEmptyLink ? 'none' : 'underline';
  668.             }
  669.         }
  670.     
  671.     }
  672. };
  673.  
  674. function LeftNav_MouseOut(p_oEvent)
  675. {
  676.     var oEvent = p_oEvent ? p_oEvent : window.event;
  677.     var oTarget = oEvent.target ? oEvent.target : oEvent.srcElement;
  678.     oTarget = oTarget.nodeType != 1 ? oTarget.parentNode : oTarget;
  679.  
  680.     var oLI;
  681.     
  682.     if(oTarget.tagName == "LI") oLI = oTarget;
  683.     else if(oTarget.parentNode.tagName == "LI") oLI = oTarget.parentNode;
  684.     else if(oTarget.parentNode.parentNode.tagName == "LI") oLI = oTarget.parentNode.parentNode;
  685.  
  686.     if(oLI) {
  687.     
  688.         var bEmptyLink = false;
  689.     
  690.         if(oTarget.tagName == "A")
  691.         {
  692.             if(oTarget.parentNode.tagName == "SPAN")
  693.             {
  694.                 oTarget.style.textDecoration = 'none';
  695.                 bEmptyLink = true;
  696.             }
  697.         }
  698.             
  699.         if(oLI.className != 'selected')
  700.         {
  701.             var bPreviousClassName = ((typeof oLI.previousClassName != 'undefined') && (oLI.previousClassName.length > 0)) ? true : false;
  702.             var sClassName = (bPreviousClassName) ? oLI.previousClassName+' hover':'hover';
  703.             if(oLI.className == sClassName) oLI.className = (bPreviousClassName) ? oLI.previousClassName:'';
  704.             if ( typeof oLI.firstChild != "undefined" && typeof oLI.firstChild.style != "undefined" ) {
  705.                 oLI.firstChild.style.textDecoration = 'none';
  706.             }
  707.         }
  708.         
  709.     }
  710. };
  711.  
  712. function LeftNav(p_sNavId)
  713. {
  714.     var oLeftNav = document.getElementById(p_sNavId);
  715.     if(oLeftNav)
  716.     {
  717.         var aULs = oLeftNav.getElementsByTagName('ul');
  718.  
  719.         if(aULs[0])
  720.         {
  721.             aULs[0].onclick = LeftNav_Click;
  722.             aULs[0].onmouseover = LeftNav_MouseOver;
  723.             aULs[0].onmouseout = LeftNav_MouseOut;
  724.         }
  725.         else return;
  726.  
  727.         if(aULs[1])
  728.         {
  729.             aULs[1].onclick = LeftNav_Click;
  730.             aULs[1].onmouseover = LeftNav_MouseOver;
  731.             aULs[1].onmouseout = LeftNav_MouseOut;
  732.         }
  733.     }
  734.     else return false;
  735. };
  736.  
  737. function DestinationFolder_Click()
  738. {
  739.     var oSender = this.Sender;
  740.     var oLI = false;
  741.  
  742.     if(!oSender.tagName) oLI = oSender.parentNode;
  743.     else if(oSender.tagName == 'LI') oLI = oSender;
  744.     else if(oSender.parentNode.tagName == 'LI') oLI = oSender.parentNode;
  745.  
  746.     if(oLI)
  747.     {
  748.         var sFolderName = oLI.getAttribute( "iname" );
  749.         var oForm = this.Button.form;
  750.         var bNewFolder = parseInt(oLI.value) == 0 ? true : false;
  751.  
  752.         if(bNewFolder)
  753.         {
  754.             var sNewFolderName = window.prompt(oForm.newfoldermessage.value,'');
  755.             
  756.             if(sNewFolderName) sNewFolderName = sNewFolderName;
  757.             else return false;
  758.  
  759.             if(sNewFolderName != null && sNewFolderName != 'null' && sNewFolderName.length != 0)
  760.             {
  761.                 oForm.NewFol.value = sNewFolderName;
  762.                 oForm.destBox.value = '@NEW';
  763.                 oForm.MOV.value = '1';
  764.                 oForm.submit();
  765.             }
  766.             else return false;
  767.         }
  768.         else
  769.         {
  770.             oForm.destBox.value = sFolderName;
  771.             oForm.MOV.value = '1';
  772.             oForm.submit();
  773.         }
  774.     }
  775.     else {
  776.         return false;
  777.     }
  778. };
  779.  
  780. function Window_Resize()
  781. {
  782.     g_oMenu.style.left = ((ylib_getPageX(g_oMenu.Button)+g_oMenu.Button.offsetWidth)-g_oMenu.Button.Menu.offsetWidth)+'px';
  783. }
  784.  
  785. function Move_Click()
  786. {
  787.     g_oMenu.style.visibility = 'visible';
  788.  
  789.     if(!this.Configured)
  790.     {
  791.         if(g_oMenu.offsetHeight > 250)
  792.         {
  793.             g_oMenu.style.width = g_oMenu.offsetWidth+20+"px";
  794.             g_oMenu.className += ' overflow';
  795.  
  796.             if(document.all && !window.showModelessDialog)
  797.             {
  798.                 g_oMenu.style.top = '-1000px';
  799.                 g_oMenu.style.left = '-1000px';
  800.             }
  801.         }
  802.         else g_oMenu.style.width = g_oMenu.offsetWidth+"px";
  803.  
  804.         document.onclick = Document_Click;
  805.         window.onresize = Window_Resize;
  806.         this.Configured = true;
  807.     }
  808.  
  809.     var nTop = (ylib_getPageY(this) + this.offsetHeight);
  810.     var nLeft = ylib_getPageX(this);
  811.     
  812.     if(oBw.ie && oBw.mac)
  813.     {
  814.         nTop -= 4;
  815.         nLeft -= 6;    
  816.     }
  817.     
  818.     g_oMenu.style.top = nTop+'px';
  819.     g_oMenu.style.left = nLeft+'px';
  820. };
  821.  
  822. function PersonalFoldersDisplayToggle_Click()
  823. {
  824.     var sDoneURL = (g_oDoneURL) ? g_sDoneURL : document.URL;
  825.     window.open("/" + g_sYMURI + "/Welcome?pers=1&.done=" + escape(sDoneURL) + "&" + g_sURLExtras, '_self');
  826. };
  827.  
  828. function MySearchesDisplayToggle_Click()
  829. {
  830.     var sDoneURL = (g_oDoneURL) ? g_sDoneURL : document.URL;
  831.     window.open("/" + g_sYMURI + "/Welcome?searches=1&.done=" + escape(sDoneURL) + "&" + g_sURLExtras, '_self');
  832. };
  833.  
  834. function AddFolderControl_Click()
  835. {
  836.     var nn = window.prompt(g_sNewFolderMessage,'');
  837.  
  838.     if(nn != null && nn != 'null' && nn != '')
  839.     {
  840.         var nn_escaped = '';
  841.         var nn_len = nn.length;
  842.  
  843.         for(i=0;i<nn_len;i++)
  844.         {
  845.             var nn_asc = nn.charCodeAt(i);
  846.             if (nn_asc == 43) nn_escaped += '%2b';
  847.             else if(nn_asc>128) nn_escaped += nn.charAt(i);
  848.             else nn_escaped += escape(nn.charAt(i));
  849.         }
  850.     
  851.         var sURL = '/'+g_sYMURI+'/Folders?ADD=1&Name=' + nn_escaped + '&.crumb='+g_sFoldersCrumb+'&.done=' + g_sAddFolderDoneURL + '&' + g_sURLExtras;
  852.         window.open(sURL, '_self');
  853.     }
  854. };
  855.  
  856. function LHCol_Init()
  857. {
  858.     g_oAddFolderDoneURL = document.getElementById('addfolderdoneurl');
  859.     g_sAddFolderDoneURL = (g_oAddFolderDoneURL) ? g_oAddFolderDoneURL.value : escape(document.URL);
  860.  
  861.     g_oDoneURL = document.getElementById('doneurl');
  862.     if(g_oDoneURL) g_sDoneURL = g_oDoneURL.value;
  863.  
  864.     g_oYMURI = document.getElementById('ymuri');
  865.     if(g_oYMURI) g_sYMURI = g_oYMURI.value;
  866.     
  867.     g_oURLExtras = document.getElementById('urlextras');
  868.     if(g_oURLExtras) g_sURLExtras = g_oURLExtras.value;
  869.  
  870.     g_oNewFolderMessage = document.getElementById('newfoldermessage');
  871.     if(g_oNewFolderMessage) g_sNewFolderMessage = g_oNewFolderMessage.value;
  872.     
  873.     g_oFoldersCrumb = document.getElementById('folderscrumb');
  874.     if(g_oFoldersCrumb) g_sFoldersCrumb = g_oFoldersCrumb.value;
  875.  
  876.     var oPersonalFoldersDisplayToggle = document.getElementById('personalfoldersdisplaytoggle');
  877.     if(oPersonalFoldersDisplayToggle)
  878.     {
  879.         oPersonalFoldersDisplayToggle.onclick = PersonalFoldersDisplayToggle_Click;
  880.         oPersonalFoldersDisplayToggle.onmouseover = function () { this.className = 'hover'; };
  881.         oPersonalFoldersDisplayToggle.onmouseout = function () { this.className = ''; };    
  882.     }
  883.  
  884.     var oMSDisplayToggle = document.getElementById('mysearchesdisplaytoggle');
  885.     if(oMSDisplayToggle)
  886.     {
  887.         oMSDisplayToggle.onclick = MySearchesDisplayToggle_Click;
  888.         oMSDisplayToggle.onmouseover = function () { this.className = 'hover'; };
  889.         oMSDisplayToggle.onmouseout = function () { this.className = ''; };    
  890.     }
  891.     
  892.     var oAddFolderControl = document.getElementById('addfoldercontrol');
  893.     
  894.     if(oAddFolderControl)
  895.     {
  896.         oAddFolderControl.onclick = AddFolderControl_Click;
  897.         oAddFolderControl.onmouseover = function () { this.className = 'hover'; };
  898.         oAddFolderControl.onmouseout = function () { this.className = ''; };
  899.     }
  900. };
  901.  
  902. //-->
  903. function ymsgr_ult_beacon(u)
  904. {
  905.     if (u)
  906.     {
  907.         u += '?.rand=' + Math.random();
  908.         var ymsgr_beacon = new Image();
  909.         ymsgr_beacon.src = u;
  910.     }
  911. }
  912.  
  913. function ymsgr_set_vm_target(self, url)
  914. {
  915.     if (ymsgr_is_messenger())
  916.     {
  917.         setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
  918.         self.href = 'ymsgr:showvm?';
  919.     }
  920.     else
  921.         self.target = "mailmsgr";
  922. }
  923.  
  924. function ymsgr_set_im_target(self, url)
  925. {
  926.     if (ymsgr_is_messenger())
  927.     {
  928.         setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
  929.         self.href = 'ymsgr:sendim?'+ get_target_yid();
  930.     }
  931.     else
  932.         self.target = "mailmsgr";
  933. }
  934.  
  935. function ymsgr_set_vc_target(self, url)
  936. {
  937.     if (ymsgr_is_messenger())
  938.     {
  939.         setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
  940.         self.href = 'ymsgr:callpc?to='+ get_target_yid();
  941.     }
  942.     else
  943.         self.target = "mailmsgr";
  944. }
  945.  
  946. function ymsgr_set_lm_beacon(self, url)
  947. {
  948.     setTimeout("ymsgr_ult_beacon('"+url+"')", 10);
  949. }
  950.  
  951. function get_target_yid()
  952. {
  953.     return typeof ymsgr_tyid == "undefined" ? "" : ymsgr_tyid;
  954. }
  955.  
  956. function ymsgr_is_messenger()
  957. {
  958.     var ymsgr_client = messenger.detect();
  959.     var ymsgr_version = ymsgr_client.version.split(',');
  960.     
  961.     if(ymsgr_client.installed && ymsgr_version[0] >= 7)
  962.     {   // < 7.0.0.182 does not support voice
  963.         return (ymsgr_version[0] > 7 || ymsgr_version[1] > 0 || ymsgr_version[2] > 0 || ymsgr_version[3] >= 182);
  964.     }
  965.     return false;
  966. }
  967. //date updated: 12.06.2005
  968.  
  969. //<xmp>
  970. /* msgr_detect.js
  971.  * a javascript library to figure out things about a locally installed messenger client
  972.  */
  973.  
  974. function Messenger() {
  975.   this.startDetect();
  976.   return null;
  977. }
  978. Messenger.prototype.installed = 0;
  979. Messenger.prototype.cobrand = '';
  980. Messenger.prototype.intl = 'us';
  981. Messenger.prototype.version = "4";
  982. Messenger.prototype.platform = "w32";
  983. Messenger.prototype.post = [];
  984. Messenger.prototype.detect = function() {
  985.   // loop through post process
  986.   for (var i=0;i<this.post.length;i++) {
  987.     this[this.post[i]]();
  988.   }
  989.   this.post=[];
  990.   return this;
  991. }
  992. Messenger.prototype.startDetect = function () {
  993.   var ok = this.detectCookie();
  994.   if (!ok) ok = this.detectBing();
  995.   if (!ok) ok = this.detectRafi();
  996.   if (!ok) ok = this.detectCapabilities();
  997.   if (!ok) ok = this.detectControl();
  998.   if (!ok) ok = this.detectMime();
  999.   /* if you don't know by now, you'll never ever know. */
  1000. }
  1001. Messenger.prototype.detectControl = function() {
  1002.   if (this.detectBrowser() == 'ie')
  1003.   {
  1004.     document.writeln("<object classid='clasid:41695A8E-6414-11D4-8FB3-00D0B7730277' hidden='true' id='Ymsgr01' width='0' height='0' codebase='tkzwtyzwzi:qwerty'><span id='Ymsgr00'></span></object>");
  1005.     this.post[this.post.length] = "postDetectControl";
  1006.   }
  1007. }
  1008. Messenger.prototype.detectBrowser = function()
  1009. {
  1010.   var ua = navigator.userAgent.toLowerCase();
  1011.  
  1012.   if (ua.indexOf('opera')!=-1)
  1013.   {
  1014.     return 'opera';
  1015.   }
  1016.   else if (ua.indexOf('msie')!=-1)
  1017.   {
  1018.     return 'ie';
  1019.   }
  1020.   else if (ua.indexOf('safari')!=-1)
  1021.   {
  1022.     return 'safari';
  1023.   }
  1024.   else if (ua.indexOf('flock')!= -1)
  1025.   {
  1026.     return 'flock';
  1027.   }
  1028.   else if (ua.indexOf('firefox')!= -1)
  1029.   {
  1030.     return 'firefox';
  1031.   }
  1032.   else if (ua.indexOf('gecko')!= -1)
  1033.   {
  1034.     return 'gecko';
  1035.   }
  1036.   else
  1037.   {
  1038.     return false;
  1039.   }
  1040. }
  1041. Messenger.prototype.postDetectControl = function() {
  1042.   var w,v;
  1043.   if (document.all) {
  1044.     v = document.all.Ymsgr00;
  1045.   } else {
  1046.     v = document.getElementById("Ymsgr00");
  1047.   }
  1048.   if (v) {
  1049.     // mutant gecko+active X case
  1050.     w = document.getElementById("Ymsgr01");
  1051.     if (w&&w.offsetHeight) {
  1052.       this.installed = 1;
  1053.       this.version = "5.02";
  1054.       this.platform = "w32";
  1055.     } else {
  1056.       return false;
  1057.     }
  1058.   } else {
  1059.     this.installed = 1;
  1060.     this.version = "5.03";
  1061.     this.platform = "w32";
  1062.   }
  1063.   return true;
  1064. }
  1065. Messenger.prototype.detectMime = function() {
  1066.   if (navigator.mimeTypes && navigator.mimeTypes.length) {
  1067.     for (var i=0; i<navigator.mimeTypes.length; i++) {
  1068.       if (navigator.mimeTypes[i].suffixes.indexOf("yps") > -1) {
  1069.          this.installed = 1;
  1070.          this.version = "5.04";
  1071.          this.platform = "w32";
  1072.          return true;
  1073.       }
  1074.     }
  1075.   }
  1076.   return false;
  1077. }
  1078. Messenger.prototype.detectCapabilities = function() {
  1079.   if (document.body && document.body.style && typeof document.body.style.behavior == "string") {
  1080.     document.body.style.behavior = "url(#default#clientCaps)";
  1081.     var ver = document.body.getComponentVersion("{E5D12C4E-7B4F-11D3-B5C9-0050045C3C96}","ComponentID");
  1082.     if (ver) {
  1083.       this.installed = 1;
  1084.       this.version = ver;
  1085.       this.platform = "w32";
  1086.       return true;
  1087.     }
  1088.   }
  1089.   return false;
  1090. }
  1091. Messenger.prototype.detectBing = function() {
  1092.   if (this.detectBrowser() == 'ie')
  1093.   {
  1094.     document.writeln('<object id="Ymsgr02" classid="CLSID:DA4F543C-C8A9-4E88-9A79-548CBB46F18F" hidden="true" width="0" height="0" codebase="tkzwtyzwzi:qwerty"></object>');
  1095.     this.post[this.post.length] = "postDetectBing";
  1096.   }
  1097. }
  1098. Messenger.prototype.postDetectBing = function() {
  1099.   var v;
  1100.   if (document.all) {
  1101.     v = document.all.Ymsgr02;
  1102.   } else { 
  1103.     // gecko w/ activeX patch
  1104.     v = document.getElementById("Ymsgr02");
  1105.   }
  1106.   if (!v) return false;
  1107.   if (typeof v.installed == "undefined") return false;
  1108.   if (typeof v.version == "undefined") return false;
  1109.   this.installed = v.installed();
  1110.   var versionstring = v.version(1);
  1111.   if (!versionstring || typeof versionstring == "undefined") return false;
  1112.   this.version = versionstring.split(".").join(",");
  1113.   this.cobrand = v.cobrand();
  1114.   this.intl = v.intl();
  1115.   return true;
  1116. }
  1117. Messenger.prototype.detectRafi = function() {
  1118.   if (!document.getElementById) return false;
  1119.   if (!navigator.plugins["Yahoo Application State Plugin"]) return false;
  1120.   document.writeln("<object id='Ymsgr03' type='application/x-vnd.yahoo.applicationState' hidden='true'></object>");
  1121.   this.post[this.post.length] = "postDetectRafi";
  1122.   return false;
  1123. }
  1124. Messenger.prototype.postDetectRafi = function() {
  1125.   var v = document.getElementById("Ymsgr03");
  1126.   if (!v) return false;
  1127.   if (typeof v.applicationInfo != "function") return false;
  1128.   var m = v.applicationInfo("msgr");
  1129.   if (!m) return false;
  1130.   this.installed = m.installed();
  1131.   var ver = m.version();
  1132.   this.version = ver.major+","+ver.minor+","+ver.hiBuild+","+ver.loBuild;
  1133.   this.cobrand = m.cobrand();
  1134.   this.intl = m.internationalCode();
  1135.   return true;
  1136. }
  1137. Messenger.prototype.detectCookie = function() {
  1138.   // check C cookie. XXX
  1139.   return false;
  1140. }
  1141.  
  1142. var messenger = new Messenger();
  1143. // Spelling stuff
  1144. function loadSpellCorrections( req, transactionID, args )
  1145. {
  1146.     var message = null;
  1147.     try {
  1148.         var scriptToRun = req.responseText.replace( /<\!--.*-->/g, "" );
  1149.         eval( scriptToRun );
  1150.         speller.setText( document.Compose.Body.value );
  1151.     } catch ( e ) {
  1152.         if ( e.message.toLowerCase() == "syntax error" ) {
  1153.             speller = new Speller([]);
  1154.         } else {
  1155.             message = e.toString() + " (" + e.message + ")";
  1156.         }
  1157.     }
  1158.     
  1159.     if ( args == null ) {
  1160.         args = [0];
  1161.     }
  1162.     
  1163.     var editBox = null;
  1164.     
  1165.     if ( typeof RTE_EDITOR_COMPOSITION_PREFIX != "undefined" ) {
  1166.         editBox = document.getElementById( RTE_EDITOR_COMPOSITION_PREFIX + args[0] );
  1167.     } else {
  1168.         editBox = document.getElementById( "bodyfield" );
  1169.     }
  1170.     
  1171.     SpellController.showController( editBox, editBox.tagName );
  1172.     speller.setEditor( editBox, args[0] );
  1173.     speller.update();
  1174. }
  1175.  
  1176. function Speller( newCorrections )
  1177. {
  1178.     this.text = "";
  1179.     this.corrections = newCorrections;
  1180.     this.changes = "";
  1181.     this.current = 0;
  1182.     this.ignore = new Object();
  1183.     this.formatted = true;
  1184.     this.state = 0;
  1185.     
  1186.     var self = this;
  1187.     
  1188.     // The following are all different if editor is an iframe
  1189.     // They will be one and the same if it is a textarea
  1190.     this.editBox = null;        // Outer frame for editor sizing & event capture
  1191.     this.editDoc = null;        // Document for event capture
  1192.     this.editContent = null;    // Container for setting innerHTML
  1193.     this.isText = false;
  1194.     this.useAX = false;
  1195.     
  1196.     this.thumbMgr = null;        // Callback to fix things up after an update
  1197.     
  1198.     this.setText = function( newText )
  1199.     {
  1200.         this.current = 0;
  1201.         this.text = newText;
  1202.     }
  1203.     
  1204.     this.setNoSuggestions = function( noSuggText )
  1205.     {
  1206.         this.noSuggestions = noSuggText;
  1207.     }
  1208.     
  1209.     this.spellingActive = function()
  1210.     {
  1211.         return ( this.state );
  1212.     }
  1213.     
  1214.     this.hideShim = function( leMenu )
  1215.     {
  1216.         hideIFrameShim();
  1217.     }
  1218.  
  1219.     this.onChange = function()
  1220.     {
  1221.         if ( this.current < this.corrections.length ) {
  1222.             this.changeWord( this.current );
  1223.             this.nextWord();
  1224.         }
  1225.     }
  1226.  
  1227.     this.onChangeAll = function()
  1228.     {
  1229.         var cur = this.corrections[this.current];
  1230.         if ( this.current < this.corrections.length ) {
  1231.             var currentWord = this.text.substr( cur.b, cur.l );
  1232.             this.changeWord( this.current );
  1233.             for ( var i = this.current + 1; i < this.corrections.length; i++ ) {
  1234.                 var corr = this.corrections[i];
  1235.                 if ( ! this.ignore[i] && this.text.substr( corr.b, corr.l ) == currentWord ) {
  1236.                     this.changeWord( i );
  1237.                     this.ignore[i] = true;
  1238.                 }
  1239.             }
  1240.             this.nextWord();
  1241.         }
  1242.     }
  1243.     
  1244.     this.onIgnore = function()
  1245.     {
  1246.         if ( this.current < this.corrections.length ) {
  1247.             this.nextWord();
  1248.         }
  1249.     }
  1250.  
  1251.     this.onIgnoreAll = function()
  1252.     {
  1253.         var cur = this.corrections[this.current];
  1254.         if ( this.current < this.corrections.length ) {
  1255.             var currentWord = this.text.substr( cur.b, cur.l );
  1256.             for ( var i = this.current + 1; i < this.corrections.length; i++ ) {
  1257.                 var corr = this.corrections[i];
  1258.                 if ( ! this.ignore[i] && this.text.substr( corr.b, corr.l ) == currentWord ) {
  1259.                     this.ignore[i] = true;
  1260.                 }
  1261.             }
  1262.             this.nextWord();
  1263.         }
  1264.     }
  1265.  
  1266.     this.onKeyPressWord = function( evt )
  1267.     {
  1268.         if ( evt.keyCode == 13 ) {
  1269.             this.onChange();
  1270.         }
  1271.     }
  1272.  
  1273.     this.nextWord = function()
  1274.     {
  1275.         while ( this.current++ < this.corrections.length && this.ignore[this.current] )
  1276.             ;
  1277.         this.update();
  1278.     }
  1279.     
  1280.     this.setEditor = function( editBox, id )
  1281.     {
  1282.         this.editBox = editBox;
  1283.         this.isText = false;
  1284.         if ( editBox.tagName == "IFRAME" ) {
  1285.             this.editDoc = editBox.contentWindow.document;
  1286.             this.editContent = this.editDoc.body;
  1287.         } else if ( editBox.tagName == "TEXTAREA" ) {
  1288.             this.editDoc = editBox;
  1289.             this.editContent = editBox;
  1290.             this.isText = true;
  1291.         } else if ( editBox.tagName == "OBJECT" ) {
  1292.             var editObj = rteEditorMap[id];
  1293.             this.editDoc = editObj.GetDocument();
  1294.             
  1295.             if ( editObj.Wrapper && editObj.Wrapper.Visible ) {
  1296.                 this.editContent = editObj.Wrapper.Content;
  1297.                 this.thumbMgr = editObj.ThumbnailManager;
  1298.             } else {
  1299.                 this.editContent = this.editDoc.body;
  1300.             }
  1301.             this.useAX = true;
  1302.         } else {
  1303.             alert( "Speller.setEditor: unknown editBox type: " + editBox.tagName + " (" + typeof editBox + ")" );
  1304.         }
  1305.         
  1306.         self.trapFocus( true );
  1307.     }
  1308.     
  1309.     this.trapFocus = function( trapping )
  1310.     {
  1311.         var evtToTrap = this.isText? "click" : (( document.all )? "focus" : "mousedown" );
  1312.         var theFrame = (document.all)? this.editBox : this.editDoc;
  1313.         if ( theFrame != null ) {
  1314.             if ( trapping ) {
  1315.                 addEvent( theFrame, evtToTrap, this.disableSpell, true );
  1316.             } else {
  1317.                 removeEvent( theFrame, evtToTrap, this.disableSpell, true );
  1318.             }
  1319.         }
  1320.     }
  1321.     
  1322.     this.disableSpell = function( evt )
  1323.     {
  1324.         HideMenu();
  1325.         if ( evt == null ) {
  1326.             evt = window.event;
  1327.         }
  1328.         self.trapFocus( false );
  1329.         self.state = 1;
  1330.         self.finish();
  1331.         
  1332.         disableItem( "changeButton", true );
  1333.         disableItem( "ignoreButton", true );
  1334.         SpellController.showMessage( "SPELL_DISABLED" );
  1335.         
  1336.         var doneButton = document.getElementById( "doneButton" );
  1337.         if ( doneButton != null ) {
  1338.             doneButton.innerHTML = SpellController.getString( "RESUME_BTN" );
  1339.             doneButton.onclick = self.enableSpell;
  1340.         }
  1341.         return true;
  1342.     }
  1343.     
  1344.     this.enableSpell = function( evt )
  1345.     {
  1346.         disableItem( "doneButton", true );
  1347.         SpellController.hideMessage();
  1348.         
  1349.         var doneButton = document.getElementById( "doneButton" );
  1350.         if ( doneButton != null ) {
  1351.             doneButton.innerHTML = SpellController.getString( "CLOSE_BTN" );
  1352.             doneButton.onclick = spellDone;
  1353.         }
  1354.         self.state = 0;
  1355.         SpellCheck_Click( this.editorID );
  1356.     }
  1357.     
  1358.     this.finish = function()
  1359.     {
  1360.         if ( this.corrections != null ) {
  1361.             this.current = this.corrections.length;    // jump to the end
  1362.             this.update();
  1363.             this.text = null;
  1364.         }
  1365.         if ( self.editDoc != null ) {
  1366.             self.trapFocus( false );
  1367.         }
  1368.     }
  1369.     
  1370.     
  1371.     this.lastIndex = 0;
  1372.     this.lastDelta = 0;
  1373.     
  1374.     this.offsetDelta = function( theText, offset )
  1375.     {
  1376.         var i = 0;
  1377.         var count = 0;
  1378.         if ( offset >= this.lastIndex ) {
  1379.             i = this.lastIndex;
  1380.             count = this.lastDelta;
  1381.         }
  1382.         var len = Math.min( offset, theText.length );
  1383.     
  1384.         while ( i < len ) {
  1385.             if ( theText.charCodeAt( i ) == 13 ) {
  1386.                 count++;
  1387.             }
  1388.             i++;
  1389.         }
  1390.         
  1391.         this.lastIndex = i;
  1392.         this.lastDelta = count;
  1393.         return count;
  1394.     }
  1395.  
  1396.  
  1397.     this.update = function()
  1398.     {
  1399. //        var theDoc = rteEditorMap[ this.editorID ].GetDocument();
  1400.         var theDoc = this.editDoc;
  1401.         var word = document.getElementById( "word" );
  1402.         var suggSelect = document.getElementById( "suggestions" );
  1403.  
  1404.         if ( this.corrections != null && this.current < this.corrections.length ) {
  1405.             var cur = this.corrections[this.current];
  1406.             if ( ! this.isText ) {
  1407.                 var html = "";
  1408.                 html += this.text.substr(0, cur.b);
  1409.                 html += '<cite id="misspelled" style="font-style:normal;font-weight:bold;color:red;">';
  1410.                 html += this.text.substr(cur.b, cur.l);
  1411.                 html += '</cite>';
  1412.     
  1413.                 html += this.text.substr(cur.b + cur.l, this.text.length - (cur.b + cur.l));
  1414.     //            theDoc.body.innerHTML = html;
  1415.                 this.editContent.innerHTML = html;
  1416.  
  1417.                 var foundWord = theDoc.getElementById( "misspelled" );
  1418.                 foundWord.scrollIntoView( false );
  1419.             } else {
  1420.                 this.editDoc.value = this.text;
  1421.                 if ( typeof( this.editBox.selectionStart ) == "undefined" ) {
  1422.                     var selectedWord = this.editBox.createTextRange();
  1423.                     if ( selectedWord != null ) {
  1424.                         selectedWord.collapse( true );
  1425.                         var adjustedStart = cur.b - this.offsetDelta( this.text, cur.b );
  1426.                         selectedWord.moveStart( "character", adjustedStart );
  1427.                         selectedWord.moveEnd( "character", cur.l );
  1428.                     }
  1429.                     selectedWord.select();
  1430.                 } else {
  1431.                     this.editBox.selectionStart = cur.b;
  1432.                     this.editBox.selectionEnd = cur.b + cur.l;
  1433.                 }
  1434.                 this.editBox.focus();
  1435.             }
  1436.     
  1437.             suggSelect.options.length = 0;
  1438.             var n = cur.s.length;
  1439.             if ( n == 0 ) {
  1440.                 word.value = this.text.substr(cur.b, cur.l);
  1441.                 suggSelect.options[0] = new Option( SpellController.getString( "NO_SUGGESTIONS" ), "", true, true );
  1442.             } else {
  1443.                 word.value = cur.s[0];
  1444.                 for (var i = 0; i < n; i++) {
  1445.                     var thisWord = cur.s[i]
  1446.                     suggSelect.options[i] = new Option( thisWord, thisWord, (i == 0), (i == 0));
  1447.                 }
  1448.                 suggSelect.selectedIndex = 0;
  1449.             }
  1450.             if ( ! this.isText ) {
  1451.                 word.select();
  1452.             }
  1453.         } else {
  1454.             if ( this.text != null && this.text != "" ) {
  1455.                 if ( ! this.isText ) {
  1456.                     this.editContent.innerHTML = this.text;
  1457.                 } else {
  1458.                     this.editDoc.value = this.text;
  1459.                 }
  1460.             }
  1461.             var message = (this.corrections.length > 0)? "NO_MORE_MISSPELLINGS" : "NO_MISSPELLINGS";
  1462.             SpellController.showMessage( message );
  1463.             disableItem( "changeButton", true );
  1464.             disableItem( "ignoreButton", true );
  1465.         }
  1466.         if ( this.thumbMgr ) {
  1467.             this.thumbMgr.RestoreThumbnails();
  1468.         }
  1469.     }
  1470.  
  1471.     this.changeWord = function( index )
  1472.     {
  1473.         var newText = "";
  1474.         var word = document.getElementById( "word" );
  1475.         
  1476.         var cur = this.corrections[index];
  1477.         
  1478.         newText += this.text.substr( 0, cur.b );
  1479.         newText += word.value;
  1480.         newText += this.text.substr( cur.b + cur.l, this.text.length - (cur.b + cur.l) );
  1481.         this.adjustOffsets( word.value.length - cur.l, index + 1 );
  1482.         this.text = newText;
  1483.         /*
  1484.         this.changes += cur.b + ," + cur.l + "," + word.value + ";";
  1485.          */
  1486.     }
  1487.  
  1488.     this.adjustOffsets = function( delta, start )
  1489.     {
  1490.         for (i = start; i < this.corrections.length; i++) {
  1491.             this.corrections[i].b += delta;
  1492.         }
  1493.     }
  1494.  
  1495.     this.getStyles = function()
  1496.     {
  1497.         var html = "";
  1498.         var styles = document.getElementsByTagName( "STYLE" );
  1499.         for ( var i = 0; i < styles.length; i++ ) {
  1500.             html += "<style>" + styles[i].innerHTML + "</style>";
  1501.         }
  1502.         return html;
  1503.     }
  1504. }
  1505.  
  1506. var SpellController =
  1507. {
  1508.     UIStrings : {
  1509.         NO_SUGGESTIONS : "No Suggestions",
  1510.         NO_MORE_MISSPELLINGS : "No more misspellings",
  1511.         NO_MISSPELLINGS : "No misspellings found",
  1512.         SPELL_DISABLED : "Spelling disabled, click Resume to continue",
  1513.         
  1514.         CHANGE_LABEL : "Change to:",
  1515.         SUGG_LABEL: "Suggestions:",
  1516.         
  1517.         CHANGE_BTN : "Change",
  1518.         IGNORE_BTN : "Ignore",
  1519.         CLOSE_BTN : "Close",
  1520.         RESUME_BTN : "Resume",
  1521.         
  1522.         CHANGE_ONE_ITEM : "Change this word",
  1523.         CHANGE_ALL_ITEM : "Change all occurrences",
  1524.         IGNORE_ONE_ITEM : "Ignore this word",
  1525.         IGNORE_ALL_ITEM : "Ignore all occurrences"
  1526.     },
  1527.     
  1528.     oldHeight : null,
  1529.     
  1530.     setString : function( id, str )
  1531.     {
  1532.         this.UIStrings[id] = str;
  1533.     },
  1534.     
  1535.     getString : function( id )
  1536.     {
  1537.         var result = this.UIStrings[id];
  1538.         if ( result == null ) {
  1539.             return id;
  1540.         }
  1541.         return result;
  1542.     },
  1543.     
  1544.     addController : function( container )
  1545.     {
  1546.         if ( typeof container == "string" ) {
  1547.             container = document.getElementById( container );
  1548.         }
  1549.         var html = "";
  1550.         html += '<div id="spellbox" class="clearfix">';
  1551.             html += '<div id="btnbox" class="first">';
  1552.                 html += '<div id="spellmsg" style="display:none"></div>';
  1553.                 html += '<div id="correction"><label for="word">' + this.getString( "CHANGE_LABEL" ) + ' </label><input id="word" onkeypress="speller.onKeyPressWord(event)" /></div>';
  1554.                 html += '<button id="changeButton" class="hasdefaultstate" type="button" value="Change" onclick="changeClick(event)">' + this.getString( "CHANGE_BTN" ) + '</button>';
  1555.                 html += '<button id="ignoreButton" class="hasdefaultstate" type="button" value="Ignore" onclick="ignoreClick(event)">' + this.getString( "IGNORE_BTN" ) + '</button>';
  1556.                 html += '<button id="doneButton" type="button" value="Close" onclick="spellDone(spellbox)">' + this.getString( "CLOSE_BTN" ) + '</button>';
  1557.             html += '</div>';
  1558.             html += '<div id="slbox">';
  1559.                 html += '<label id="sugglabel" for="suggestions">' + this.getString( "SUGG_LABEL" ) + ' </label>';
  1560.                 html += '<select id="suggestions" size="4" onchange="SpellController.onChangeSuggestions()"></select>';
  1561.             html += '</div>';
  1562.         html += '</div>';
  1563.         
  1564.         html += '<div id="changemenu" class="buttonmenu" container="' + container.id +'">';
  1565.             html += '<strong>Change Options</strong>';
  1566.             html += '<ul>';
  1567.                 html += '<li value="0">' + this.getString( "CHANGE_ONE_ITEM" ) + '</li>';
  1568.                 html += '<li value="1">' + this.getString( "CHANGE_ALL_ITEM" ) + '</li>';
  1569.             html += '</ul>';
  1570.         html += '</div>';
  1571.         
  1572.         html += '<div id="ignoremenu" class="buttonmenu" container="' + container.id +'">';
  1573.             html += '<strong>Change Options</strong>';
  1574.             html += '<ul>';
  1575.                 html += '<li value="0">' + this.getString( "IGNORE_ONE_ITEM" ) + '</li>';
  1576.                 html += '<li value="1">' + this.getString( "IGNORE_ALL_ITEM" ) + '</li>';
  1577.             html += '</ul>';
  1578.         html += '</div>';
  1579.         
  1580.         container.innerHTML = html;
  1581.         var oChangeMenu = MenuButton( 'changeButton', changeClick, 'changemenu', changeMenuClick );
  1582.         var oSkipMenu = MenuButton( 'ignoreButton', ignoreClick, 'ignoremenu', ignoreMenuClick );
  1583.     },
  1584.     
  1585.     showController : function( editBox )
  1586.     {
  1587.         var spellBox = document.getElementById( "spellbox" );
  1588.         if ( spellBox == null ) {
  1589.             SpellController.addController( "spellcontrol" );
  1590.             spellBox = document.getElementById( "spellbox" );
  1591.         }
  1592.         if ( spellBox != null ) {
  1593.             spellBox.style.display = "block";
  1594.  
  1595.             if ( typeof editBox != "undefined" && editBox != null ) {
  1596.                 if ( this.oldHeight == null ) {
  1597.                     this.oldHeight = editBox.clientHeight;
  1598.                     this.editBox = editBox;
  1599.                     editBox.style.height = editBox.clientHeight - spellBox.offsetHeight + "px";
  1600.                 }
  1601.                 // If it's a TEXTAREA, the user may have set the size.  We need to match that.
  1602.                 if ( editBox.tagName == "TEXTAREA" ) {
  1603.                     this.setBoxWidth( editBox, spellBox );
  1604.                 }
  1605.             }
  1606.             this.hideMessage();
  1607.             // Make sure everything is enabled!
  1608.             disableItem( "changeButton", false );
  1609.             disableItem( "ignoreButton", false );
  1610.             disableItem( "doneButton", false );
  1611.             disableItem( "word", false );
  1612.             disableItem( "suggestions", false );
  1613.         }
  1614.     },
  1615.     
  1616.     setBoxWidth : function( editBox, spellBox )
  1617.     {
  1618.         // We only need to do this once...
  1619.         if ( spellBox.getAttribute( "width_set" ) != null ) {
  1620.             return;
  1621.         }
  1622.         var width = editBox.offsetWidth;
  1623.         spellBox.style.width = width + "px";
  1624.         // You'd think that since we've set the width, we're done!
  1625.         // But the W3C in its infinite wisdom won't set the width
  1626.         // the the value you asked for!  We need to see what width
  1627.         // we ended up with and subtract any offsets that were added in...
  1628.         var delta = spellBox.offsetWidth - width;
  1629.         if ( delta != 0 ) {
  1630.             width -= delta;
  1631.             spellBox.style.width = width + "px";
  1632.         }
  1633.         
  1634.         var btnbox = document.getElementById( "btnbox" );
  1635.         var slbox = document.getElementById( "slbox" );
  1636.  
  1637.         if ( btnbox != null && slbox != null ) {            
  1638.             var delta = ( width - ( btnbox.offsetWidth + slbox.offsetWidth) ) / 2;
  1639.             var word = document.getElementById( "word" );
  1640.             var suggestions = document.getElementById( "suggestions" );
  1641.             
  1642.             if ( delta > 0 && word != null ) {
  1643.                 word.style.width = (word.offsetWidth + delta) + "px";
  1644.             }
  1645.             
  1646.             if ( suggestions != null ) {
  1647.                 suggestions.style.width = (suggestions.offsetWidth + delta) + "px";
  1648.             }
  1649.         }
  1650.         spellBox.setAttribute( "width_set", "1" );
  1651.     },
  1652.     
  1653.     hideController : function( id )
  1654.     {
  1655.         var spellBox = document.getElementById( "spellbox" );
  1656.         if ( spellBox != null ) {
  1657.             // var editBox = document.getElementById( id );
  1658.             if ( this.editBox != null && this.oldHeight != null ) {
  1659.                 this.editBox.style.height = this.oldHeight + "px";
  1660.                 this.oldHeight = null;
  1661.             }
  1662.             spellBox.style.display = "none";
  1663.         }
  1664.     },
  1665.     
  1666.     disableItem : function( itemID, disabled )
  1667.     {
  1668.     },
  1669.     
  1670.     onChangeSuggestions : function()
  1671.     {
  1672.         var suggSelect = document.getElementById( "suggestions" );
  1673.         var suggestion = suggSelect.options[suggSelect.selectedIndex].value;
  1674.         if ( suggestion != "" ) {
  1675.             document.getElementById( "word" ).value = suggestion;
  1676.         }
  1677.     },
  1678.     
  1679.     showMessage : function( msg )
  1680.     {
  1681.         var messageArea = document.getElementById( "spellmsg" );
  1682.         if ( messageArea != null ) {
  1683.             messageArea.innerHTML = this.getString( msg );
  1684.             var theBox = document.getElementById( "correction" );
  1685.             if ( theBox != null ) {
  1686.                 theBox.style.display = "none";
  1687.             }
  1688.             theBox = document.getElementById( "sugglabel" );
  1689.             if ( theBox != null ) {
  1690.                 theBox.style.display = "none";
  1691.             }
  1692.             theBox = document.getElementById( "suggestions" );
  1693.             if ( theBox != null ) {
  1694.                 theBox.style.display = "none";
  1695.             }
  1696.             
  1697.             messageArea.style.display = "block";
  1698.         }
  1699.     },
  1700.     
  1701.     hideMessage : function()
  1702.     {
  1703.         var messageArea = document.getElementById( "spellmsg" );
  1704.         if ( messageArea != null ) {
  1705.             messageArea.style.display = "none";
  1706.             
  1707. //            messageArea.innerHTML = msg;
  1708.             var theBox = document.getElementById( "correction" );
  1709.             if ( theBox != null ) {
  1710.                 theBox.style.display = "";
  1711.             }
  1712.             theBox = document.getElementById( "sugglabel" );
  1713.             if ( theBox != null ) {
  1714.                 theBox.style.display = "";
  1715.             }
  1716.             theBox = document.getElementById( "suggestions" );
  1717.             if ( theBox != null ) {
  1718.                 theBox.style.display = "";
  1719.             }
  1720.         }
  1721.     }
  1722. }
  1723.  
  1724. function spellDone( id )
  1725. {
  1726.     if ( typeof speller != 'undefined' && speller != null ) {
  1727.         speller.finish();
  1728.         SpellController.hideController( id );
  1729.         speller = null;
  1730.     }
  1731.     enableSpell( true );
  1732. }
  1733.  
  1734.     
  1735. function disableItem( itemID, disabled )
  1736. {
  1737.     var color = ( (disabled)? "#999" : "#000" );
  1738.     var theItem = document.getElementById( itemID );
  1739.     if ( theItem != null ) {
  1740.         theItem.disabled = disabled;
  1741.         theItem.style.color = color;
  1742.     }
  1743. }
  1744.  
  1745. function changeClick()
  1746. {
  1747.     var mainWidth = parseInt( this.offsetWidth );
  1748.     mainWidth -= 22;
  1749.     var nOffsetX = (this.Event.layerX) ? (this.Event.layerX) : this.Event.offsetX;
  1750.     
  1751.     if ( nOffsetX > mainWidth ) {
  1752.         var leMenu = this.Menu;
  1753.         if ( leMenu != null ) {
  1754.             leMenu.style.zIndex = 100;
  1755.             leMenu.Show();
  1756.             leMenu.hideCB = speller.hideShim;
  1757.             showIFrameShim( leMenu );
  1758.         }
  1759.     } else {
  1760.         speller.onChange();
  1761.     }
  1762. }
  1763.  
  1764. function changeMenuClick()
  1765. {
  1766.     switch( this.Sender.value ) {
  1767.     case 0: speller.onChange();
  1768.         break;
  1769.     case 1: speller.onChangeAll();
  1770.         break;
  1771.     default: alert( "Unknown change option: " + this.Sender.value );
  1772.         break;
  1773.     }
  1774.     HideMenu();
  1775. }
  1776.  
  1777. function ignoreClick()
  1778. {
  1779.     var mainWidth = parseInt( this.offsetWidth );
  1780.     mainWidth -= 22;
  1781.     var nOffsetX = (this.Event.layerX) ? (this.Event.layerX) : this.Event.offsetX;
  1782.     
  1783.     if ( nOffsetX > mainWidth ) {
  1784.         var leMenu = this.Menu;
  1785.         if ( leMenu != null ) {
  1786.             leMenu.style.zIndex = 100;
  1787.             leMenu.Show();
  1788.             leMenu.hideCB = speller.hideShim;
  1789.             showIFrameShim( leMenu );
  1790.         }
  1791.     } else {
  1792.         speller.onIgnore();
  1793.     }
  1794. }
  1795.  
  1796. function ignoreMenuClick()
  1797. {
  1798.     switch( this.Sender.value ) {
  1799.     case 0: speller.onIgnore();
  1800.         break;
  1801.     case 1: speller.onIgnoreAll();
  1802.         break;
  1803.     default: alert( "Unknown this.ignore option: " + this.Sender.value );
  1804.         break;
  1805.     }
  1806.     HideMenu();
  1807. }
  1808.  
  1809.